package com.gisocn.onemap.ui.fragment;

import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.esri.android.map.Layer;
import com.esri.core.geometry.Geometry;
import com.gisocn.onemap.base.Constant;
import com.gisocn.onemap.databinding.FragmentQueryStatisticsBinding;
import com.gisocn.onemap.event.MessageEvent;
import com.gisocn.onemap.interfaces.OnSingleItemClickListener;
import com.gisocn.onemap.model.AppConfig;
import com.gisocn.onemap.model.DynamicLayerList;
import com.gisocn.onemap.model.FieldDataBean;
import com.gisocn.onemap.model.GroupLayer;
import com.gisocn.onemap.model.LandInfo;
import com.gisocn.onemap.model.LayerInfoBean;
import com.gisocn.onemap.model.LayerSelectBean;
import com.gisocn.onemap.model.QueryStatisticsResultBean;
import com.gisocn.onemap.model.QueryXML;
import com.gisocn.onemap.model.SQLOldQuery;
import com.gisocn.onemap.model.Subcatalog;
import com.gisocn.onemap.mvp.base.MvpFragment;
import com.gisocn.onemap.mvp.contact.QueryStatisticsContact;
import com.gisocn.onemap.mvp.presenter.QueryStatisticsPresenter;
import com.gisocn.onemap.sgzx.R;
import com.gisocn.onemap.ui.activity.MainActivity;
import com.gisocn.onemap.ui.adapter.QueryStatisticsBaseAdapter;
import com.gisocn.onemap.ui.alert.AlertColumnSelected;
import com.gisocn.onemap.ui.alert.AlertLayerSelect;
import com.gisocn.onemap.utils.GsonUtil;
import com.gisocn.onemap.utils.LogUtils;
import com.gisocn.onemap.utils.SpUtils;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

/* loaded from: classes.dex */
public class QueryStatisticsDataFragment extends MvpFragment<FragmentQueryStatisticsBinding, QueryStatisticsContact.Presenter> implements QueryStatisticsContact.View {
    private LayerInfoBean currentLayerInfoBean;
    private String layerName;
    private MainActivity mainActivity;
    private QueryStatisticsBaseAdapter queryStatisticsBaseAdapter;
    private String selectFieldName;
    private String serviceUrl;
    private String showLayersData;
    private String tableName;
    private final List<LayerInfoBean> layerList = new ArrayList();
    private final List<QueryStatisticsResultBean> queryDataList = new ArrayList();
    private Layer currentSelectLayer = null;

    @Override // com.gisocn.onemap.mvp.base.BaseFragment
    protected Object getLayoutId() {
        return Integer.valueOf((int) R.layout.fragment_query_statistics);
    }

    @Override // com.gisocn.onemap.mvp.base.BaseFragment
    protected void initView() {
        EventBus.getDefault().register(this);
        ((FragmentQueryStatisticsBinding) this.mViewBinding).layoutTitle.tvTitle.setText(R.string.query_statistics);
        if (this.mainActivity == null) {
            this.mainActivity = (MainActivity) this.mActivity;
        }
        if (this.queryStatisticsBaseAdapter == null) {
            ((FragmentQueryStatisticsBinding) this.mViewBinding).recycleQuery.setLayoutManager(new LinearLayoutManager(this.mContext));
            this.queryStatisticsBaseAdapter = new QueryStatisticsBaseAdapter(R.layout.item_query_statistics, this.queryDataList);
            ((FragmentQueryStatisticsBinding) this.mViewBinding).recycleQuery.setAdapter(this.queryStatisticsBaseAdapter);
            this.queryStatisticsBaseAdapter.setOnItemClickListener(new OnSingleItemClickListener() { // from class: com.gisocn.onemap.ui.fragment.QueryStatisticsDataFragment.1
                @Override // com.gisocn.onemap.interfaces.OnSingleItemClickListener
                protected void onSingleItemClick(BaseQuickAdapter<?, ?> baseQuickAdapter, View view, int i) {
                    QueryStatisticsResultBean queryStatisticsResultBean;
                    Geometry geometry;
                    if (i >= QueryStatisticsDataFragment.this.queryDataList.size() || (queryStatisticsResultBean = (QueryStatisticsResultBean) QueryStatisticsDataFragment.this.queryDataList.get(i)) == null || (geometry = queryStatisticsResultBean.getGeometry()) == null) {
                        return;
                    }
                    QueryStatisticsDataFragment.this.queryStatisticsBaseAdapter.notifyDataSetChanged(i);
                    QueryStatisticsDataFragment.this.loadGeometry(geometry);
                    List<QueryStatisticsResultBean.FieldDataBean> fieldDataList = queryStatisticsResultBean.getFieldDataList();
                    if (fieldDataList != null && fieldDataList.size() > 0) {
                        ArrayList<LandInfo> arrayList = new ArrayList<>();
                        for (QueryStatisticsResultBean.FieldDataBean fieldDataBean : fieldDataList) {
                            StringBuilder sb = new StringBuilder();
                            sb.append("zxhhh125--> ");
                            sb.append(fieldDataBean.getFieldName());
                            sb.append(" , ");
                            sb.append(fieldDataBean.getAliasName());
                            sb.append(" , ");
                            sb.append(fieldDataBean.getFieldValue());
                            sb.append(" , ");
                            sb.append(!TextUtils.isEmpty(fieldDataBean.getAliasName()));
                            sb.append(" , ");
                            sb.append(!TextUtils.isEmpty(fieldDataBean.getFieldValue()));
                            LogUtils.i(sb.toString());
                            if (!TextUtils.isEmpty(fieldDataBean.getAliasName()) && !TextUtils.isEmpty(fieldDataBean.getFieldValue())) {
                                LandInfo landInfo = new LandInfo();
                                landInfo.setName(fieldDataBean.getAliasName());
                                landInfo.setValue(fieldDataBean.getFieldValue());
                                arrayList.add(landInfo);
                            }
                        }
                        if (arrayList.size() > 0) {
                            QueryStatisticsDataFragment.this.mainActivity.showLandInfoDetailPopWindow(arrayList);
                            return;
                        }
                        return;
                    }
                    String tableName = queryStatisticsResultBean.getTableName();
                    if (TextUtils.isEmpty(tableName)) {
                        return;
                    }
                    ((QueryStatisticsContact.Presenter) QueryStatisticsDataFragment.this.getPresenter()).getXmlInfo(tableName, i, queryStatisticsResultBean.getPkUid());
                }
            });
        }
        getCanQueryListData();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public void loadGeometry(Geometry geometry) {
        this.mainActivity.getMapView().setExtent(geometry);
        this.mainActivity.loadGeometry(geometry, "", 2);
    }

    private void getCanQueryListData() {
        DynamicLayerList dynamicLayerList;
        DynamicLayerList.Catalog catalog;
        ArrayList<Subcatalog> subcatalog;
        AppConfig appConfig = this.mainActivity.getAppConfig();
        if (appConfig == null || (dynamicLayerList = appConfig.getDynamicLayerList()) == null || (catalog = dynamicLayerList.getCatalog()) == null || (subcatalog = catalog.getSubcatalog()) == null || subcatalog.size() <= 0) {
            return;
        }
        Iterator<Subcatalog> it = subcatalog.iterator();
        while (it.hasNext()) {
            Iterator<GroupLayer> it2 = it.next().getGroupLayers().iterator();
            while (it2.hasNext()) {
                Iterator<LayerInfoBean> it3 = it2.next().getLayer().iterator();
                while (it3.hasNext()) {
                    LayerInfoBean next = it3.next();
                    LayerInfoBean.Statistics statistics = next.getStatistics();
                    if (statistics != null) {
                        String canQuery = statistics.getCanQuery();
                        if (!TextUtils.isEmpty(canQuery) && canQuery.equals("YES")) {
                            this.layerList.add(next);
                        }
                    }
                }
            }
        }
    }

    public void getCurrentPosition() {
        this.currentSelectLayer = null;
        Layer[] layers = this.mainActivity.getMapView().getLayers();
        if (layers != null && layers.length > 0) {
            int length = layers.length - 1;
            while (true) {
                if (length < 0) {
                    break;
                }
                Layer layer = layers[length];
                LogUtils.i("zxhhh85--> " + layers.length + " , " + layer.getName());
                if (layer != null && !TextUtils.isEmpty(layer.getName()) && !layer.getName().equals("VEC_C") && !layer.getName().contains("IMG_C") && !layer.getName().equals("CIA_C") && !layer.getName().equals("CVA_C") && !this.mainActivity.isBaseMap(layer.getName()) && layer.isVisible() && !layer.getName().startsWith("http")) {
                    this.currentSelectLayer = layer;
                    break;
                }
                length--;
            }
        }
        this.currentLayerInfoBean = getSelectedLayerInfoData();
        getQueryFields();
    }

    private LayerInfoBean getSelectedLayerInfoData() {
        if (this.currentSelectLayer != null && this.layerList.size() > 0) {
            for (int i = 0; i < this.layerList.size(); i++) {
                LayerInfoBean layerInfoBean = this.layerList.get(i);
                LogUtils.i("zxhhh1558--> " + this.currentSelectLayer.getName() + " , " + layerInfoBean.getName() + " , " + layerInfoBean.getService());
                if (this.currentSelectLayer.getName().equals(layerInfoBean.getName()) || this.currentSelectLayer.getName().equals(layerInfoBean.getService())) {
                    return layerInfoBean;
                }
            }
        }
        return null;
    }

    private void cleanQueryFields() {
        this.layerName = "";
        this.selectFieldName = "";
        ((FragmentQueryStatisticsBinding) this.mViewBinding).tvSelectedLayerName.setText("");
        ((FragmentQueryStatisticsBinding) this.mViewBinding).tvSelectedColumn.setText("");
        this.tableName = "";
        this.serviceUrl = "";
        this.showLayersData = "";
    }

    /* JADX INFO: Access modifiers changed from: private */
    public void getQueryFields() {
        cleanQueryFields();
        LayerInfoBean layerInfoBean = this.currentLayerInfoBean;
        if (layerInfoBean == null) {
            return;
        }
        this.layerName = layerInfoBean.getName();
        ((FragmentQueryStatisticsBinding) this.mViewBinding).tvSelectedLayerName.setText(this.layerName);
        String shapeFile = this.currentLayerInfoBean.getShapeFile();
        if (shapeFile.contains(".")) {
            shapeFile = shapeFile.substring(0, shapeFile.lastIndexOf("."));
        }
        this.tableName = shapeFile;
        this.serviceUrl = this.currentLayerInfoBean.getService();
        this.showLayersData = this.currentLayerInfoBean.getShowlayers();
        LogUtils.i("zxhhh290--> " + this.layerName + " , " + this.tableName + " , " + this.serviceUrl + " , " + this.showLayersData);
        cleanWhereAndResult(false);
    }

    @Override // com.gisocn.onemap.mvp.base.BaseFragment
    protected void initListener() {
        ((FragmentQueryStatisticsBinding) this.mViewBinding).layoutTitle.tvClose.setOnClickListener(new View.OnClickListener() { // from class: com.gisocn.onemap.ui.fragment.QueryStatisticsDataFragment.2
            @Override // android.view.View.OnClickListener
            public void onClick(View view) {
                QueryStatisticsDataFragment.this.mainActivity.setViewPagerVisibility(false);
            }
        });
        ((FragmentQueryStatisticsBinding) this.mViewBinding).tvClear.setOnClickListener(new View.OnClickListener() { // from class: com.gisocn.onemap.ui.fragment.QueryStatisticsDataFragment.3
            @Override // android.view.View.OnClickListener
            public void onClick(View view) {
                QueryStatisticsDataFragment.this.cleanWhereAndResult(true);
            }
        });
        ((FragmentQueryStatisticsBinding) this.mViewBinding).tvGoQuery.setOnClickListener(new View.OnClickListener() { // from class: com.gisocn.onemap.ui.fragment.-$$Lambda$QueryStatisticsDataFragment$zbLp-4mmlMryzc0HUNJxvNZLO8k
            {
                QueryStatisticsDataFragment.this = this;
            }

            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                QueryStatisticsDataFragment.this.lambda$initListener$0$QueryStatisticsDataFragment(view);
            }
        });
        ((FragmentQueryStatisticsBinding) this.mViewBinding).rlSelectedLayerName.setOnClickListener(new View.OnClickListener() { // from class: com.gisocn.onemap.ui.fragment.-$$Lambda$QueryStatisticsDataFragment$FZK7pASInu4f4Tz6DVrASziCkIw
            {
                QueryStatisticsDataFragment.this = this;
            }

            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                QueryStatisticsDataFragment.this.lambda$initListener$1$QueryStatisticsDataFragment(view);
            }
        });
        ((FragmentQueryStatisticsBinding) this.mViewBinding).rlSelectedColumn.setOnClickListener(new View.OnClickListener() { // from class: com.gisocn.onemap.ui.fragment.QueryStatisticsDataFragment.5
            @Override // android.view.View.OnClickListener
            public void onClick(View view) {
                if (QueryStatisticsDataFragment.this.currentSelectLayer == null) {
                    QueryStatisticsDataFragment.this.showToast("请选择需查询图层");
                } else {
                    new AlertColumnSelected().setAnchorView((mViewBinding).rlSelectedColumn).setSelectLayer(currentSelectLayer).setShowLayersData(showLayersData).setTableName(tableName).setOnColumnSelectCallback(new AlertColumnSelected.OnColumnSelectCallback() { // from class: com.gisocn.onemap.ui.fragment.QueryStatisticsDataFragment.5.1
                        @Override // com.gisocn.onemap.ui.alert.AlertColumnSelected.OnColumnSelectCallback
                        public void selectCallback(FieldDataBean fieldDataBean) {
                            QueryStatisticsDataFragment.this.selectFieldName = fieldDataBean.getFieldName();
                            ((FragmentQueryStatisticsBinding) QueryStatisticsDataFragment.this.mViewBinding).tvSelectedColumn.setText(fieldDataBean.getAliasName());
                        }
                    }).show(QueryStatisticsDataFragment.this.getFragmentManager(), "alertColumnSelected");
                }
            }
        });
        ((FragmentQueryStatisticsBinding) this.mViewBinding).tvImmediatelyQuery.setOnClickListener(new View.OnClickListener() { // from class: com.gisocn.onemap.ui.fragment.QueryStatisticsDataFragment.6
            @Override // android.view.View.OnClickListener
            public void onClick(View view) {
                if (QueryStatisticsDataFragment.this.currentLayerInfoBean != null) {
                    if (TextUtils.isEmpty(QueryStatisticsDataFragment.this.serviceUrl)) {
                        return;
                    }
                    if (TextUtils.isEmpty(QueryStatisticsDataFragment.this.selectFieldName)) {
                        QueryStatisticsDataFragment.this.showToast("请选择查询字段");
                        return;
                    }
                    QueryStatisticsDataFragment.this.showProgressDialog("查询中...");
                    QueryStatisticsDataFragment.this.cleanWhereAndResult(false);
                    String obj = ((FragmentQueryStatisticsBinding) QueryStatisticsDataFragment.this.mViewBinding).etQuery.getText().toString();
                    if (QueryStatisticsDataFragment.this.serviceUrl.startsWith("http")) {
                        if (QueryStatisticsDataFragment.this.currentSelectLayer != null) {
                            ((QueryStatisticsContact.Presenter) QueryStatisticsDataFragment.this.getPresenter()).sqlHttpQuery(QueryStatisticsDataFragment.this.currentSelectLayer, QueryStatisticsDataFragment.this.showLayersData, obj, QueryStatisticsDataFragment.this.selectFieldName, QueryStatisticsDataFragment.this.layerName);
                            return;
                        }
                        return;
                    }
                    ((QueryStatisticsContact.Presenter) QueryStatisticsDataFragment.this.getPresenter()).sqlQuery(QueryStatisticsDataFragment.this.tableName, obj, QueryStatisticsDataFragment.this.selectFieldName, QueryStatisticsDataFragment.this.mainActivity.getMapView().getSpatialReference(), QueryStatisticsDataFragment.this.layerName);
                    return;
                }
                QueryStatisticsDataFragment.this.showToast("请选择需查询图层");
            }
        });
        ((FragmentQueryStatisticsBinding) this.mViewBinding).tvStatistics.setOnClickListener(new View.OnClickListener() { // from class: com.gisocn.onemap.ui.fragment.-$$Lambda$QueryStatisticsDataFragment$1AhtlOn1xj_IrOJYgUFMxrPfwrY
            {
                QueryStatisticsDataFragment.this = this;
            }

            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                QueryStatisticsDataFragment.this.lambda$initListener$2$QueryStatisticsDataFragment(view);
            }
        });
    }

    public /* synthetic */ void lambda$initListener$0$QueryStatisticsDataFragment(View view) {
        ((FragmentQueryStatisticsBinding) this.mViewBinding).rlQueryStatistics.setVisibility(8);
        ((FragmentQueryStatisticsBinding) this.mViewBinding).rlQuery.setVisibility(0);
    }

    public /* synthetic */ void lambda$initListener$1$QueryStatisticsDataFragment(View view) {
        new AlertLayerSelect().setAnchorView(((FragmentQueryStatisticsBinding) this.mViewBinding).rlSelectedLayerName).setLayerInfoList(this.layerList).setMainActivity(this.mainActivity).setOnLayerSelectCallback(new AlertLayerSelect.OnLayerSelectCallback() { // from class: com.gisocn.onemap.ui.fragment.QueryStatisticsDataFragment.4
            @Override // com.gisocn.onemap.ui.alert.AlertLayerSelect.OnLayerSelectCallback
            public void selectCallback(LayerSelectBean layerSelectBean) {
                Layer layer = layerSelectBean.getLayer();
                LayerInfoBean layerInfoBean = layerSelectBean.getLayerInfoBean();
                if (layer == null || layerInfoBean == null) {
                    return;
                }
                if (QueryStatisticsDataFragment.this.currentSelectLayer != null && QueryStatisticsDataFragment.this.currentSelectLayer.getName().equals(layer.getName()) && QueryStatisticsDataFragment.this.currentSelectLayer.getUrl().equals(layer.getUrl())) {
                    return;
                }
                QueryStatisticsDataFragment.this.currentSelectLayer = layer;
                QueryStatisticsDataFragment.this.currentLayerInfoBean = layerInfoBean;
                QueryStatisticsDataFragment.this.getQueryFields();
            }
        }).show(getFragmentManager(), "alertLayerSelect");
    }

    public /* synthetic */ void lambda$initListener$2$QueryStatisticsDataFragment(View view) {
        showToast("未配置统计信息");
    }

    /* JADX INFO: Access modifiers changed from: private */
    public void cleanWhereAndResult(boolean z) {
        if (z) {
            ((FragmentQueryStatisticsBinding) this.mViewBinding).etQuery.setText("");
        }
        this.mainActivity.removethandPaintLayer();
        this.mainActivity.disMissAllPopupWindow();
        this.mainActivity.closeStatistic();
        if (this.queryDataList.size() > 0) {
            this.queryDataList.clear();
        }
        ((FragmentQueryStatisticsBinding) this.mViewBinding).tvCount.setText("");
        ((FragmentQueryStatisticsBinding) this.mViewBinding).tvCount.setVisibility(8);
        ((FragmentQueryStatisticsBinding) this.mViewBinding).rlQuery.setVisibility(0);
        ((FragmentQueryStatisticsBinding) this.mViewBinding).rlQueryStatistics.setVisibility(8);
        QueryStatisticsBaseAdapter queryStatisticsBaseAdapter = this.queryStatisticsBaseAdapter;
        if (queryStatisticsBaseAdapter != null) {
            queryStatisticsBaseAdapter.notifyDataSetChanged(-1);
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMessageEvent(MessageEvent messageEvent) {
        if (messageEvent == null || TextUtils.isEmpty(messageEvent.eventType)) {
            return;
        }
        LogUtils.i("zxhhh1542--> " + messageEvent.eventType);
        String str = messageEvent.eventType;
        str.hashCode();
        if (str.equals(Constant.MESSAGE_EVENT_QUERY_LAWYER_OPEN) || str.equals(Constant.MESSAGE_EVENT_UPDATA_LAYER_DATA_ALL)) {
            cleanWhereAndResult(false);
            getCurrentPosition();
        }
    }

    @Override // com.gisocn.onemap.mvp.base.MvpFragment, com.gisocn.onemap.mvp.base.BaseFragment, androidx.fragment.app.Fragment
    public void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }

    @Override // com.gisocn.onemap.mvp.base.MvpFragment
    public QueryStatisticsContact.Presenter createPresenter() {
        return new QueryStatisticsPresenter();
    }

    @Override // com.gisocn.onemap.mvp.contact.QueryStatisticsContact.View
    public void sqlQuerySuccess(final List<QueryStatisticsResultBean> list, final String str, final String str2) {
        this.mActivity.runOnUiThread(new Runnable() { // from class: com.gisocn.onemap.ui.fragment.QueryStatisticsDataFragment.7
            @Override // java.lang.Runnable
            public void run() {
                QueryStatisticsDataFragment.this.closeLoadingDialog();
                QueryStatisticsDataFragment.this.setSqlQueryStatistics(list, str, str2);
            }
        });
    }

    @Override // com.gisocn.onemap.mvp.contact.QueryStatisticsContact.View
    public void sqlQueryFail(final String str) {
        this.mActivity.runOnUiThread(new Runnable() { // from class: com.gisocn.onemap.ui.fragment.QueryStatisticsDataFragment.8
            @Override // java.lang.Runnable
            public void run() {
                QueryStatisticsDataFragment.this.closeLoadingDialog();
                QueryStatisticsDataFragment.this.showToast(str);
            }
        });
    }

    @Override // com.gisocn.onemap.mvp.contact.QueryStatisticsContact.View
    public void getXmlInfoSuccess(QueryXML queryXML, String str, String str2) {
        if (new File(Constant.SAVE_PATH_SHP + str2 + ".db").exists()) {
            getPresenter().sqlQueryLandInfo(queryXML, str2, str);
        }
    }

    @Override // com.gisocn.onemap.mvp.contact.QueryStatisticsContact.View
    public void getXmlInfoFail(String str) {
        showToast(str);
    }

    @Override // com.gisocn.onemap.mvp.contact.QueryStatisticsContact.View
    public void sqlQueryLandInfoSuccess(JsonObject jsonObject, QueryXML queryXML) {
        ArrayList<QueryXML.Field> fields;
        JsonElement jsonElement;
        final ArrayList arrayList = new ArrayList();
        if (queryXML != null && (fields = queryXML.getFields()) != null && fields.size() > 0) {
            Iterator<QueryXML.Field> it = fields.iterator();
            while (it.hasNext()) {
                QueryXML.Field next = it.next();
                String name = next.getName();
                if (!TextUtils.isEmpty(name) && (jsonElement = jsonObject.get(name)) != null) {
                    LandInfo landInfo = new LandInfo();
                    landInfo.setName(next.getAliasname());
                    landInfo.setValue(jsonElement.getAsString());
                    arrayList.add(landInfo);
                }
            }
        }
        this.mActivity.runOnUiThread(new Runnable() { // from class: com.gisocn.onemap.ui.fragment.QueryStatisticsDataFragment.9
            @Override // java.lang.Runnable
            public void run() {
                QueryStatisticsDataFragment.this.mainActivity.showLandInfoDetailPopWindow(arrayList);
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: private */
    public void setSqlQueryStatistics(List<QueryStatisticsResultBean> list, String str, String str2) {
        if (list.size() > 0) {
            this.queryDataList.addAll(list);
        }
        if (!TextUtils.isEmpty(str) && this.queryDataList.size() > 0) {
            SQLOldQuery sQLOldQuery = new SQLOldQuery();
            sQLOldQuery.setDate(new SimpleDateFormat("yyyy-MM-dd hh:mm").format(new Date()));
            sQLOldQuery.setSqlStr(str);
            sQLOldQuery.setDbPath(str2);
            sQLOldQuery.setLayerName(this.layerName);
            ArrayList arrayList = new ArrayList();
            String string = SpUtils.getString(this.mContext, "sqlOldQuery");
            if (!TextUtils.isEmpty(string)) {
                arrayList.addAll((List) GsonUtil.getInstance().getGson().fromJson(string, new TypeToken<List<SQLOldQuery>>() { // from class: com.gisocn.onemap.ui.fragment.QueryStatisticsDataFragment.10
                }.getType()));
            }
            arrayList.add(sQLOldQuery);
            SpUtils.put(this.mContext, "sqlOldQuery", GsonUtil.getInstance().getGson().toJson(arrayList));
        }
        ((FragmentQueryStatisticsBinding) this.mViewBinding).rlQueryStatistics.setVisibility(this.queryDataList.size() > 0 ? 0 : 8);
        ((FragmentQueryStatisticsBinding) this.mViewBinding).rlQuery.setVisibility(this.queryDataList.size() > 0 ? 8 : 0);
        ((FragmentQueryStatisticsBinding) this.mViewBinding).tvCount.setVisibility(this.queryDataList.size() <= 0 ? 8 : 0);
        TextView textView = ((FragmentQueryStatisticsBinding) this.mViewBinding).tvCount;
        textView.setText("共" + this.queryDataList.size() + "条记录");
        this.queryStatisticsBaseAdapter.notifyDataSetChanged(-1);
    }
}
